package br.com.powerfy.template;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;

import br.com.powerfy.exception.SistemaException;

public abstract class JDBCTemplateBase {
	
	@Autowired
	private DataSource dataSource;
	
	private NamedParameterJdbcTemplate jdbcTemplate;
          
    
    @Autowired
    public JDBCTemplateBase(DataSource dataSource)throws SistemaException{
    	jdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
    }


	public DataSource getDataSource() {
		return dataSource;
	}


	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}


	public NamedParameterJdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}


	public void setJdbcTemplate(NamedParameterJdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}


    
    
    
}
